<template>
    <div class="neeatnr">
        <div class="layout">
            <div><h2>新增员工账号</h2></div>
            <div class="body" style="border: 1px solid; padding: 20px ">
                <div class="password" v-for="item in dat" :key="item.id">
                    <span>{{item.text}}</span>
                    <input class='text' v-model="item.txt" type="text" style="border: 1px solid rgb(133, 133, 133);">
                </div>
                <div class="button">
                    <input
                            style="width: 100px"
                            type="button"
                            @click="change()"
                            value="保存">
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "Neeatnr",
        data(){
            return{
                dat:[
                    {
                        text: '姓名：',
                        txt:'',
                        name: 'name',
                    },
                    {
                        text: '员工号：',
                        txt:'',
                        name:'zhanghao',
                    },
                    {
                        text: '状态：',
                        txt:'',
                        name: 'state',
                    },
                    {
                        text: '联系电话：',
                        txt:'',
                        name: 'telephone',
                        
                    },
                    {
                        text: '角色：',
                        txt:'',
                        name: 'role',
                         
                    },
                    {
                        text: '岗位：',
                        txt:'',
                        name: 'position',
                        
                    },
                    {
                        text: '部门：',
                        txt:'',
                        name: 'department',
                        
                    },
                    {
                        text: '主管领导：',
                        txt:'',
                        name: 'superior',
                        
                    },
                    {
                        text: '岗位描述：',
                        txt:'',
                        name: 'description',
                        
                    },
                    {
                        text: '负责区域：',
                        txt:'',
                        name: 'area',
                    },
                ]
            }
        },
        methods:{
            change:function(){
                var data={}
                data.name=this.dat[0].txt
                data.zhnaghao=this.dat[1].txt
                data.state=this.dat[2].txt
                data.telephone=this.dat[3].txt
                data.role=this.dat[4].txt
                data.position=this.dat[5].txt
                data.department=this.dat[6].txt
                data.superior=this.dat[7].txt
                data.description=this.dat[8].txt
                data.area=this.dat[9].txt
                console.log(data)
                this.$router.push({
                    name:'Eeaymt',
                    params:{
                         data:this.dat
                    }
                    })
            }
        }
    }
</script>

<style scoped>
    li{
        list-style-type: none;
    }
    h2{
        width: 150px;
        margin: 20px auto;
    }
    .password{
        margin-bottom: 20px;
        padding-right: 15px;
        display: flex;
        justify-content: flex-end;
    }
    .button{
        display: flex;
        justify-content: center;
        width: 300px;
    }
    .neeatnr{
        width: 100%;
        height: 100%;
    }
    .body{
        width: 300px;
        height: 490px;
        border: 1px solid #000;
        background-color: #EFEFEF;
        margin: 0 auto;
    }
    .flow{
        display: none;
    }
    .flows{
        display: block;
    }
</style>